Skip to content

TUI: skip unchanged running-command height remeasurement - #14595

Open
harryalbert wants to merge 1 commit into
masterfrom
harry/tui-running-agent-command-height-cache
Open

TUI: skip unchanged running-command height remeasurement#14595
harryalbert wants to merge 1 commit into
masterfrom
harry/tui-running-agent-command-height-cache

Conversation

@harryalbert

@harryalbert harryalbert commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a targeted follow-up for expanded shell commands that are still running inside Warp Agent CLI blocks. The downstack paint fix (#14594) bounds inline terminal rendering to visible rows, but the transcript viewport still remeasured the entire agent block on every layout while an expanded command was running—even when the terminal row extent had not changed. Generic streaming status also forced repeated measurement despite agent-output updates already dirtying their rich-content item directly.

This change records each running shell command's rendered height and displayed command/output row extents after layout. Stable-width viewport layouts now reuse the cached agent-block height while those extents are unchanged; new terminal rows, width changes, disclosure changes, and normal dirty invalidations still trigger measurement. The viewport collects candidate rich-content IDs while holding the terminal-model lock, then releases it before querying child views, avoiding nested terminal-model locking when reading live command geometry. Regression coverage verifies same-row terminal updates reuse the cached height, row growth remeasures, completion stops dynamic measurement, and ordinary agent-output updates continue refreshing canonical scroll extent.

Benchmark at 120×50 versus downstack PR #14594. The fixture invalidates only the transcript viewport—not the retained agent block—so it measures the unchanged-row relayout path affected by this PR:

  • Expanded running command, 100 output rows: 19.786 → 18.417 µs/frame (7.1% faster, p=0.01).
  • Expanded running command, 1,000 output rows: 19.119 → 18.472 µs/frame (3.9% faster, p=0.02).

Agent conversation: https://staging.warp.dev/conversation/963ead54-9843-4cc1-8d8b-dbf695ee7046

Linked Issue

N/A — Warp Agent CLI transcript rendering performance.

Testing

  • cargo nextest run -p warpui_core --features tui — 557 passed, 7 skipped.

  • cargo nextest run -p warp_tui — 937 passed.

  • cargo clippy -p warp_tui --features test-util --benches -- -D warnings

  • cargo bench -p warp_tui --features test-util --bench transcript_bench -- 'tui_transcript/running_agent_command/viewport_relayout_unchanged_frame'

  • ./script/format

  • I have manually tested my changes locally with ./script/run-tui

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2026

harryalbert commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@harryalbert
harryalbert marked this pull request as ready for review July 31, 2026 16:58
@oz-for-oss

oz-for-oss Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@harryalbert

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR narrows TUI agent-block height polling so expanded running command blocks are remeasured only when their terminal row extent changes, with supporting tests and a benchmark fixture.

Concerns

  • This is a user-visible TUI behavior change, but the PR description does not include manual testing output or acceptable TUI evidence such as a terminal transcript, render-to-lines/TuiBuffer snapshot diff, or ./script/run-tui capture demonstrating the running-command row-growth behavior end to end.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@harryalbert
harryalbert force-pushed the harry/tui-lrc-within-agent-block-fix branch from b621986 to c7ed842 Compare July 31, 2026 17:27
@harryalbert
harryalbert force-pushed the harry/tui-running-agent-command-height-cache branch from 061ca10 to fbdaa82 Compare July 31, 2026 17:27
@harryalbert harryalbert changed the title TUI: remeasure running agent commands on row growth TUI: skip unchanged running-command height remeasurement Jul 31, 2026
@harryalbert
harryalbert requested a review from kevinyang372 July 31, 2026 17:31
Base automatically changed from harry/tui-lrc-within-agent-block-fix to master July 31, 2026 17:46
Co-Authored-By: Oz <oz-agent@warp.dev>
@harryalbert
harryalbert force-pushed the harry/tui-running-agent-command-height-cache branch from fbdaa82 to 8e32733 Compare July 31, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant